

   var ds = new Ext.data.Store({
        proxy: new Ext.data.HttpProxy({
            url: basePath+'/../catalog'
        }),
        reader: new Ext.data.JsonReader({
            root: 'content'
        }, [
            {name: 'id', mapping: 'id'},
            {name: 'name', mapping: 'name'}
        ]),
        baseParams: {searchMess:searchMess}

    });

    //ds.loadData(myData);

    // example of custom renderer function
    function italic(value){
        return '<i>' + value + '</i>';
    }

    // example of custom renderer function
    function change(val){
        if(val > 0){
            return '<tpl for="."><div class="search-item"><span style="color:green;">' + val + '</span></div></tpl>';
        }else if(val < 0){
            return '<tpl for="."><div class="search-item"><span style="color:red;">' + val + '</span></div></tpl>';
        }
        return val;
    }
    // example of custom renderer function
    function pctChange(val){
        if(val > 0){
            return '<div class="search-item"><span style="color:green;">AAA' + val + '%</span></div>';
        }else if(val < 0){
            return '<div class="search-item"><span style="color:red;">AAA' + val + '%</span></div>';
        }
        return val;
    }

    // the DefaultColumnModel expects this blob to define columns. It can be extended to provide
    // custom or reusable ColumnModels
    var colModel = new Ext.grid.ColumnModel([
        {id:'company',header: "序号", width: 45, sortable: true, dataIndex: 'id',menuDisabled:true},
        {header: "章节名称", width: 180, sortable: true, dataIndex: 'name',menuDisabled:true}
    ]);


    // create the Grid
    var grid = new Ext.grid.GridPanel({
        el:'search_panel',
        ds: ds,
        cm: colModel,
        height:550,
        width:260,
        sm: new Ext.grid.RowSelectionModel({singleSelect: true})
    });
	ds.load({params:{'searchMess':searchMess}});
	grid.render();
	grid.on('rowclick', function(g, rowIdx, e) {
		updataCaContent({doClass:"content", chapterId:ds.getAt(rowIdx).data.id})
	});


 /*****更新目录和右边显示区********/
 /**点击任意目录条，全文显示区显示该章节的全部条文****url为出全文路径*****/
	function updataCaContent(p){

	   if(!centerPanel)
	     {
		     alert('框架页面加载错误！');
		     return;
	     }
	     var centerUrl = basePath+'/ca/caContent.jsp';
	     centerPanel.getUpdater().update({
	      	url: centerUrl,
	      	params: p,
	      	scripts:true
		});
	}
	if(doClass == 'original'){
		updataCaContent({doClass:'original',searchMess:searchMess});
	}